package com.ssy.jt808.gateway.adapter.model;

/**
 * 响应状态枚举类
 *
 * @author yezhihao
 * https://gitee.com/yezhihao/jt808-server
 */
public enum APICodes implements APICode{

    Success(200, ""),

    BadRequest(400, "请求失败"),
    MissingParameter(400, "缺少必要的参数"),
    Unauthorized(401, "授权失败"),

    UnregisteredUser(402, "未注册的用户"),
    NotPermission(403, "没有权限"),
    OfflineClient(404, "离线的客户端"),
    TypeMismatch(406, "参数格式不正确"),
    InvalidParameter(406, "无效的参数"),
    NotSupportedType(406, "不支持的请求类型"),
    NotImplemented(406, "未实现的方法"),
    Timeout(408, "消息发送成功,客户端响应超时"),
    OperationFailed(420, "操作失败"),
    UnknownError(500, "未知错误");

    private final String code;
    private final String message;

    APICodes( int code, String message ){
        this.code = String.valueOf(code);
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}